package com.pengcheng.taskapplication.mvp.view.activity;

import android.view.View;
import android.widget.TextView;

import com.pengcheng.taskapplication.R;
import com.pengcheng.taskapplication.model.NoticeModel;
import com.pengcheng.taskapplication.net.ConvertUtil;
import com.pengcheng.taskapplication.util.ToastUtils;

import java.io.Serializable;

import butterknife.BindView;
import butterknife.OnClick;

public class NoticeDetailActivity extends BaseActivity  {


    @BindView(R.id.tv_title)
    TextView tv_title;

    @BindView(R.id.tv_time)
    TextView tv_time;

    @BindView(R.id.tv_content)
    TextView tv_content;

    @BindView(R.id.tv_center_title)
    TextView tv_center_title;


    @Override
    protected int layoutResID() {
        return R.layout.activity_notice_detail;
    }

    @Override
    protected void initData() {
     NoticeModel noticeModel= (NoticeModel) getIntent().getSerializableExtra("model");
        tv_center_title.setText("公告详情");
     if(noticeModel!=null){
         tv_title.setText(noticeModel.getTitle());
         tv_time.setText(ConvertUtil.getDateToShortString(noticeModel.getTime()));
         tv_content.setText(noticeModel.getContent());
     }

    }


    @OnClick({R.id.img_back})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.img_back:
                finish();
                break;
        }
    }
}
